package com.kinghood.productcenter.common.model.dto.product;

import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.kinghood.productcenter.common.model.vo.product.ProductAttributeListVO;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

@Data
@ContentRowHeight(100)
public class ProductExportExcelDTO {
    private Long id;
    /**
     * 款号
     */
    private String styleNumber;

    /**
     * 款式名
     */
    private String styleName;

    /**
     * 商品状态（）
     */
    private Integer status;
    private String StatusTxt;

    /**
     * 品牌id
     */
    private Long brandId;
    private String brandName;

    /**
     * 货类id
     */
    private Long goodsId;
    private String goodsName;

    /**
     * 品类id
     */
    private Long categoryId;
    private String categoryName;

    /**
     * 编码后缀
     */
    private String codeSuffix;

    /**
     * 工厂图
     */
    private String factoryPicture;

    /**
     * 手拍图
     */
    private String handPicture;

    /**
     * 高清图
     */
    private String hdPicture;

    /**
     * 运营图
     */
    private String operationPicture;

    /**
     * 属性值
     */
    private List<ProductAttributeListVO> attribute;

    /**
     * 创建人
     */
    private Long createUserId;
    private String createUserName;
    private String createUserAccount;

    /**
     * 最后修人
     */
    private Long updateUserId;
    private String updateUserName;
    private String updateUserAccount;

    public String getPirture() {
        if (StringUtils.isNotBlank(this.hdPicture)) {
            return this.hdPicture;
        }
        if (StringUtils.isNotBlank(this.operationPicture)) {
            return this.operationPicture;
        }
        if (StringUtils.isNotBlank(this.handPicture)) {
            return this.handPicture;
        }
        return factoryPicture;
    }
}
